package org.springcloud.plugin.stragegy.sentinel.parser;

import com.alibaba.csp.sentinel.datasource.Converter;
import com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;

import java.util.List;

/**
 * @Author yanggld
 * @Date 2020/1/10-15:30
 * @Description
 * 热点参数限流规则
 */
public class SentinelParamFlowRuleParser implements Converter<String, List<ParamFlowRule>> {
	@Override
	public List<ParamFlowRule> convert(String source) {
		return JSON.parseObject(source, new TypeReference<List<ParamFlowRule>>() {});
	}
}